package Model;

import java.util.EnumSet;

import Common.Direction;

public class Cell {
 
	public int X;
	public int Y;
	
	public boolean VisidtedWhileGeneration = false;	
	
	public EnumSet<Direction> Border = EnumSet.noneOf(Direction.class);
	public EnumSet<Direction> Walls = EnumSet.noneOf(Direction.class);
	public EnumSet<Direction> PathTried = EnumSet.noneOf(Direction.class);
	
	public Cell(int x, int y)
	{
		X = x;
		Y = y;
		Walls.addAll(EnumSet.allOf(Direction.class));
		Border.clear();
	}

	public void SetBorder(Direction borderToSet)
	{
		Border.add(borderToSet);
	}
	
	public void SetBorder(EnumSet<Direction> borderSetToSet)
	{
		Border.addAll(borderSetToSet);
	}
	
	public void RemoveBorder()
	{
		Border.remove(Direction.class);
	}
	
	public void RemoveWall(Direction wallToRemove)
	{
		Walls.remove(wallToRemove);
	}
	
	public void RemoveWall(EnumSet<Direction> wallSetToRemove)
	{
		Walls.removeAll(wallSetToRemove);
	}

	public boolean IsBorderSet(Direction borderDirection) 
	{
		return Border.contains(borderDirection);
	}
	
	public boolean IsBorderSet(EnumSet<Direction> borderSetDirection) 
	{
		return Border.containsAll(borderSetDirection);
	}
	
	public boolean IsWall(Direction wallToCheck)
	{
		return Walls.contains(wallToCheck);
	}
	
	public boolean IsWall(EnumSet<Direction> wallSetToCheck)
	{
		return Walls.contains(wallSetToCheck);
	}
	
	public boolean IsPathVisited(Direction directionToCheck)
	{
		return PathTried.contains(directionToCheck); 
	}
	
	public boolean IsPathVisited(EnumSet<Direction> directionSetToCheck)
	{
		return PathTried.containsAll(directionSetToCheck); 
	}
	
}
